import request from '@/utils/request'

export default {
  /**
   * 获取角色列表
   * @param {*} data
   * @returns
   */
  queryList(data) {
    return request({
      url: '/energy-carbon/grass-core/role/queryPage',
      method: 'post',
      data
    })
  },
  /**
   * 新增角色
   * @param {*} data
   * @returns
   */
  roleAdd(data) {
    return request({
      url: '/energy-carbon/grass-core/role/add',
      method: 'post',
      data
    })
  },
  /**
   * 详情
   * @param {*} data
   * @returns
   */
  detail(data) {
    return request({
      url: '/energy-carbon/grass-core/role/detail',
      method: 'post',
      data
    })
  },
  /**
   * 编辑角色
   * @param {*} data
   * @returns
   */
  roleUpdate(data) {
    return request({
      url: '/energy-carbon/grass-core/role/update',
      method: 'post',
      data
    })
  },
  /**
   * 编辑角色，启用禁用
   * @param {*} data
   * @returns
   */
  enableOrDisable(data) {
    return request({
      url: '/energy-carbon/grass-core/role/enableOrDisable',
      method: 'post',
      data
    })
  },
  /**
   * 新增删除
   * @param {*} data
   * @returns
   */
  roleDelById(data) {
    return request({
      url: '/energy-carbon/grass-core/role/deleteById',
      method: 'post',
      data
    })
  },
  /**
   * 获取角色权限列表信息
   * @param {*} data
   * @returns
   */
  allotPermission(data) {
    return request({
      url: '/energy-carbon/grass-core/role/allotPermission',
      method: 'post',
      data
    })
  },
  /**
   * 查看所属用户
   * @param {*} data
   * @returns
   */
  queryAscriptionUser(data) {
    return request({
      url: '/energy-carbon/grass-core/role/queryAscriptionUser',
      method: 'post',
      data
    })
  },
  /**
   * 查看所属用户
   * @param {*} data
   * @returns
   */
  updateAscriptionUser(data) {
    return request({
      url: '/energy-carbon/grass-core/role/updateAscriptionUser',
      method: 'post',
      data
    })
  },
  /**
   * 批量删除
   * @param {*} data
   * @returns
   */
  batchDelete(data) {
    return request({
      url: '/energy-carbon/grass-core/role/batchDelete',
      method: 'post',
      data
    })
  }
}
